#ifndef SEQUENCER_HPP_
#define SEQUENCER_HPP_

#include <set>

namespace KitTool
{
	/**
	 * This class is responsible for generating a sequence of integer values that
	 * are strictly decreasing. It implements also some logic that allows to skip
	 * some values if we don't need them. If i.e we have value 5 in the skip set,
	 * and our counter is 4, then the next value will be 6.
	 */
	class Sequencer
	{
	public:
		/**
		 * The constructor creates the class and initialize the counter to a value
		 * given as a parameter.
		 *
		 * \param iInitValue the init value of the counter.
		 */
		Sequencer(unsigned long long iInitValue):_expectedElement(iInitValue){}

		/**
		 * The method adds a value that should be skipped while incrementing.
		 *
		 * \param iValueToSkip the value to be skipped while incrementing.
		 */
		void addToSkip(unsigned long long iValueToSkip){_skip.insert(iValueToSkip);}

		/**
		 * \return the current value of the counter.
		 */
		unsigned long long getExpectedNo() const {return _expectedElement;}

		/**
		 * Increment the value of the counter, skipping values that are kept in the set.
		 */
		void increment();
	private:
		// contains the values that should be skipped while implementation
		std::set <unsigned long long> _skip;
		// contains the current value of the counter
		unsigned long long _expectedElement;
	};
}


#endif /* SEQUENCER_HPP_ */
